home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_tem_lavabubboss2.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  122 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEM_LavaBubBoss2.cog
  4. #
  5. # [TRM]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. # ========================================================================================
  9.  
  10. symbols
  11.  
  12.     message     user0
  13.     message     entered
  14.     message     pulse
  15.     
  16.     thing       blurp           local
  17.     thing       bloop0
  18.     thing       bloop1
  19.     thing       bloop2
  20.     thing       bloop3
  21.     thing       bloop4
  22.     
  23.     sector      sec_Start1
  24.     sector      sec_Start2
  25.     sector      sec_Stop1
  26.     sector      sec_Stop2
  27.     
  28.     template    tpl_Bubble=lavabubopp       local
  29.     template    tpl_Sparks=lavasparks       local
  30.  
  31.     material    bubbleSkin=bubble_a4lava_top.mat        local
  32.     material    lavaSkin=gen_a4sfx_lava_particle.mat    local
  33.     
  34.     sound       sfx_Bloop0=gen_lava_bloop_a.wav      local
  35.     sound       sfx_Bloop1=gen_lava_blurp_a.wav      local
  36.     
  37.     int         animId      local
  38.     int         newBubble   local
  39.     int         oldBubble   local
  40.     int         bubbling=0  local
  41.     int         done=0      local
  42.     
  43. end
  44.  
  45. # ========================================================================================
  46.  
  47. code
  48.  
  49. user0:
  50.  
  51.     SetPulse(0.0);
  52.     done = 1;
  53.  
  54.     return;
  55.  
  56. # ========================================================================================
  57.  
  58. entered:
  59.  
  60.     if((GetSenderRef() == sec_Start1) || (GetSenderRef() == sec_Start2))
  61.     {
  62.         if((bubbling == 0) && (done == 0))
  63.         {
  64.             Print("startBubbles");
  65.             bubbling = 1;
  66.             #Sleep(0.5);
  67.             SetPulse(1.0);
  68.         }
  69.     }
  70.  
  71.     if((GetSenderRef() == sec_Stop1) || (GetSenderRef() == sec_Stop2))
  72.     {
  73.         Print("stopBubbles");
  74.         SetPulse(0.0);
  75.         bubbling = 0;
  76.     }
  77.     
  78.     return;
  79.  
  80. # ========================================================================================
  81.  
  82. pulse:
  83.  
  84.     while (newBubble == oldBubble) 
  85.     {
  86.         newBubble = RandBetween(0, 4);
  87.     }
  88.     
  89.     oldBubble = newBubble;
  90.     
  91.     # create bubble at random position
  92.     blurp = CreateThing(tpl_Bubble, bloop0[newBubble]);
  93.     CaptureThing(blurp);
  94.     
  95.     # move bubble to frame
  96.     MoveToFrame(blurp, 1, 1.5);
  97.     
  98.     # animate the bubble mat
  99.     SetMaterialCel(bubbleskin, 0);
  100.     animId = MaterialAnim(bubbleskin, 48, 0);
  101.     
  102.     # play the bloop/blurp sfx
  103.     PlaySoundThing(sfx_Bloop0[RandBetween(0, 1)], blurp, 1.0, 18.0, 23.0, 0x0);
  104.     
  105.     # create lava sparks
  106.     SetMaterialCel(lavaskin, 0);
  107.     CreateThing(tpl_Sparks, bloop0[newBubble]);
  108.     MaterialAnim(lavaskin, 4, 0);
  109.     
  110.     # get ready for the next one
  111.     WaitForStop(blurp);
  112.     Sleep(0.45);
  113.     #StopAnim(animId);
  114.     DestroyThing(blurp);
  115.     
  116.     return;
  117.  
  118. # ========================================================================================
  119.  
  120. end
  121.  
  122.